package exception;

import enums.CommonErrorEnum;

public class CommonException extends RuntimeException{

    private String code;

    private String message;

    public CommonException(String message) {
        this.message = message;
    }

    public CommonException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public CommonException(CommonErrorEnum error) {
        String messageEn = error.getMessage();
        this.code = error.getCode();
        this.message = error.getMessageCN();
    }

    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
